var express = require('express');
var router = express.Router();
let multer = require('multer');
// 权限验证
const authMiddleware = require('../utils/middleware/auth');
const admin = require('../controllers/admin')
let upload = multer({ dest: './public/uploads/carousel/' }).single('file')
/* GET users listing. */
// console.log(admin)
router.get('/login', admin.loginControllers.login);
router.get('/getUser', authMiddleware, admin.userControllers.getUsers);
router.get('/getHomeData', authMiddleware, admin.homeControllers.getHomeData);
router.post('/saveCertification', authMiddleware, admin.userControllers.saveCertification);
router.get('/getCarousel', authMiddleware, admin.carouselControllers.getCarousel);
router.get('/getMoment', authMiddleware, admin.momentControllers.getMoment);
router.get('/getMomentType', authMiddleware, admin.momentControllers.getMomentType);
router.post('/delMomentType', authMiddleware, admin.momentControllers.delMomentType);
router.post('/createMomentType', authMiddleware, admin.momentControllers.createMomentType);
router.get('/getComments', authMiddleware, admin.momentControllers.getComments)
router.post('/shieldMoment', authMiddleware, admin.momentControllers.shieldMoment);



module.exports = router;